<?php
/**
 # com_jvframwork - JV Framework
 # @version		1.5.x
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/
//no direct access
defined( '_JEXEC' ) or die( 'Retricted Access' );
$pKey = $this->PKEY;
?>
<form action="<?php echo $this->FORM_LINK ?>" method="post" name="adminForm">
<div id="block-tab">
    <div class="tbl-content">
      <table class="adminlist">
        <thead>
          <tr class="theme-header"> 
            <th width="2%"> <?php echo $this->NUM ?></th>            
            <th colspan="2" width="32%"><?php echo $this->THEME_NAME ?></th>
            <th width="5%"><?php echo $this->DEFAULT ?></th>
            <th width="5%"> <?php echo $this->ASSIGNED ?></th>
            <th width="10%"><?php echo $this->VERSION ?></th>
            <th width="14%"><?php echo $this->CREATION_DATE ?></th>
            <th width="18%"><?php echo $this->AUTHOR ?></th>
            <th width="5%"><?php echo $this->STATUS ?></th>
            <th width="2%">ID</th>
          </tr>  
        </thead>
    <?php
    $n = count( $this->data );
    if(count( $this->data )){ 
        $k = 0;
        for ($i=0; $i < $n; $i++)
        {
            $row =& $this->data[$i];
            $id  = isset($row[$pKey]) ? $row[$pKey]: $row['theme'];            
            $checked = '<input type="radio" onclick="isChecked(this.checked);" value="'.$id.'" name="cid[]" id="cb'.$i.'">';; 
            $link = JRoute::_( $this->FORM_LINK.'&task=edit&cid[]='.$id );
            $link2= "javascript:void(0)";
            ?>
            <tr class="<?php echo "row$k"; ?>">
              <td align="center"><?php echo $this->pagination->getRowOffset( $i ) ?></td>
              <td width="2%" align="center"><?php echo $checked; ?></td>
              <td align="left" valign="middle">  
                <a href="<?php if(is_numeric($id)) echo $link; else echo $link2; ?>" class="theme hasTip" <?php if(is_numeric($id)) echo 'title="Status::'.JText::_('COM_JVFRAMEWORK_THEMES_STATUS_ACTIVE').'"'; else echo 'title="Status::'.JText::_('COM_JVFRAMEWORK_THEMES_STATUS_DEACTIVE').'"'; ?>> 
                    <?php if(isset($row['theme'])) {?>
                        <img src="<?php echo JURI::root().'templates/'.JVTEMPLATE.'/themes/'.$row['theme'].'/thumbnail.jpg' ?>"/>
                        <span id="<?php echo $row['name']; ?>" class="desc"><?php echo $row['name']; ?></span>
                    <?php } ?>                
                </a> 
              </td>
              <td align="center">
                <?php if(isset($row['home']) && $row['home'] == 1){?>
                    <img src="<?php echo JURI::base().'components/'.$this->OPTION.'/assets/images/default_small.png'?>" title="<?php echo JText::_('DEFAULT') ?>" /> 
                <?php } ?>
              </td>
              <td align="center">
                <?php $params = isset($row['params']) ? json_decode($row['params'],1) : null; if(isset($params['menuassign']) && $params['menuassign'] != ''){?>
                    <img src="<?php echo JURI::base().'components/'.$this->OPTION.'/assets/images/tick.png'?>" title="<?php echo JText::_('ASSIGNED') ?>" /> 
                <?php } ?>
              </td>
              <td align="center"><?php if(isset($row['version'])) echo $row['version']; ?></td>
              <td><?php if(isset($row['creationdate'])) echo $row['creationdate']; ?></td>
              <td>
                <strong style="font-size: 16px;"><?php if(isset($row['author'])) echo $row['author']; ?></strong><br /><br />
                <strong><?php echo JText::_('COM_JVFRAMEWORK_THEMES_EMAIL'); ?></strong>: <a href="mailto:<?php if(isset($row['authorEmail'])) echo $row['authorEmail']; ?>"><?php if(isset($row['authorEmail'])) echo $row['authorEmail']; ?></a><br />
                <strong><?php echo JText::_('COM_JVFRAMEWORK_THEMES_WEBSITE'); ?></strong>: <a href="<?php if(isset($row['authorUrl'])) echo $row['authorUrl']; ?>"><?php if(isset($row['authorUrl'])) echo $row['authorUrl']; ?></a>
              </td> 
              <td align="center">
                <?php if($row['status'] == 1){ ?>
                    <img title="<?php echo JText::_('COM_JVFRAMEWORK_THEMES_STATUS_ACTIVE') ?>" src="<?php echo JURI::base().'components/'.$this->OPTION.'/assets/images/activated_small.png' ?>" />
                <?php } else {?>
                    <img title="<?php echo JText::_('COM_JVFRAMEWORK_THEMES_STATUS_DEACTIVE') ?>" src="<?php echo JURI::base().'components/'.$this->OPTION.'/assets/images/deactivated_small.png' ?>" />
                <?php } ?>
              </td>
              <td align="center"><?php echo $id; ?></td>
            </tr>            
            <?php
            $k = 1 - $k;
        }
    }
    ?>
        </table>
    </div>
  </div>  
  <input type="hidden" name="option" value="<?php echo $this->OPTION ?>" />
  <input type="hidden" name="c" value="" />
  <input type="hidden" name="task" value="" />  
  <input type="hidden" name="boxchecked" value="0" />
  <?php echo $this->TOKEN; ?> 
</form>